package com.yalisanda.edu.exceptionhandler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.ylsdxy.model.response.ResponseResult;

@RestControllerAdvice
@Slf4j
public class ExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public ResponseResult<Object> doException(Exception e) {
        log.error(e.getMessage());
        log.error(e.toString());
        return new ResponseResult<>(500, "系统发生未知错误，打电话让运维来加班！", null);
    }
}
